export const httpGet = async (url, params) => {
	let [_, res] = await uni.request({
		url,
		method: 'GET',
		data: params,
	})
	return res
}

export const httpPost = async (url, data) => {
	let [err, res] = await uni.request({
		url,
		method: 'POST',
		data,
		header: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	})
	return [err, res]
}

export const filePost = async (url, data) => {
	let [_, res] = await uni.request({
		url,
		method: 'POST',
		data,
		header: {
			'content-type': 'application/json'
		}
	})
	return res
}

export const fileUploader = async (url, filePath, data) => {
	const res = await uni.uploadFile({
		url,
		filePath,
		formData: data,
		name: '录音',
		header: {
			'Content-Type': 'multipart/form-data'
		}
	})
	return res
	
}

